<!--
--审批页面
-->
<template>
  <!-- 审批中 -->
  <div class="box clearfix">
    <section class="section_wrap">
      <FunctionalAreas></FunctionalAreas>
      <div class="title_sub prduct_bod_r">产品说明：</div>
      <ProductDescriptionToo></ProductDescriptionToo>
    </section>
    <section class="section_wrap">
      <div class="title_sub infro_bod_l">信息查看：</div>
      <div class="state">状态：审批中</div>
      <InformationsViewer
        :orderNumber="orderNumber"
        :showButton="showButton"
        :reviewer="reviewer"
      ></InformationsViewer>
    </section>
    <!-- <section class="section_wrap" v-if="isContract != 0">
      <p>客户姓名：{{ showForm.basicBorrowerName }}</p>
      <el-button
        type="primary"
        style="width: 150px; margin-top: 20px"
        @click="agentFun"
        >代理合同下载</el-button
      >
      <el-button
        type="primary"
        style="width: 150px; margin-top: 20px"
        @click="signatureFun"
        >代理签字页下载</el-button
      >
      <el-button
        type="primary"
        style="width: 150px; margin-top: 20px"
        @click="cheackFun"
        >担保合同模板下载</el-button
      >
      <el-dialog
        title="信息核对"
        :visible.sync="dialogVisibleAgent"
        :before-close="handleCloseAgent"
        width="1000px"
      >
        <AgentDia
          :showForm="showForm"
          :isContract="isContract"
          ref="agentDia"
        ></AgentDia>
      </el-dialog>
      <el-dialog
        title="信息核对"
        :visible.sync="dialogVisibleSignature"
        :before-close="handleCloseSignature"
        width="1000px"
      >
        <SignatureDia
          :showForm="showForm"
          :isContract="isContract"
          ref="SignatureDia"
        ></SignatureDia>
      </el-dialog>
      <el-dialog
        title="信息核对"
        :visible.sync="dialogVisible"
        :before-close="handleCloseCheck"
        width="1000px"
      >
        <CheckDia
          :showForm="showForm"
          :isContract="isContract"
          ref="CheckDia"
        ></CheckDia>
      </el-dialog>
    </section> -->
    <section class="section_wrap" v-show="showFillAnIn">
      <div class="title_sub infro_bod_l">审批信息：</div>
      <FillAnInFormation
        @showbox="toshow"
        :orderNumber="orderNumber"
      ></FillAnInFormation>
    </section>
    <section class="section_wrap"  v-if="showFinancialInfo">
      <div class="title_sub infro_bod_l">财务信息:</div>
      <financialInfo :showBtn="showBtn" :orderNumber="orderNumber"></financialInfo>
    </section>
      <section class="section_wrap">
      <div class="title_sub infro_bod_l">风控大数据查询</div>
      <viewInfo> </viewInfo>
    </section>
	
    <section class="section_wrap">
      <div class="title_sub upload_bod_l">附件管理：</div>
      <!-- 上传组件 -->
      <Upload class="uploadStyle" :isNew="isNew"></Upload>
    </section>
    <section class="section_wrap">
      <div class="title_sub appro_bod_r">审批流：</div>
      <ExaminationApproval :ProductUrl="ProductUrl"></ExaminationApproval>
      <div class="title_sub infro_bod_l">操作记录：</div>
      <OperationRecords :orderNumber="orderNumber"></OperationRecords>
    </section>
  </div>
</template>

<script>
import { getProductUrl, getFindForm } from "../../../src/assets/js/api";
import FunctionalAreas from "../../components/businessList/FunctionalAreas";
import ProductDescriptionToo from "../../components/businessList/ProductDescriptionToo";
import InformationsViewer from "../../components/businessList/InformationsViewer";
import FillAnInFormation from "../../components/businessList/FillAnInFormation";
import Upload from "../../components/businessList/Upload";
import ExaminationApproval from "../../components/businessList/ExaminationApproval";
import OperationRecords from "../../components/businessList/OperationRecords";
import viewInfo from "../../components/business/viweInfo.vue";
// import CheckDia from "../../components/InformationCheck/Check";
// import AgentDia from "../../components/InformationCheck/Agent";
// import SignatureDia from "../../components/InformationCheck/Signature";
import financialInfo from "../../components/business/financialInfo";
import {checkPermiss} from "../../assets/js/utlis";

export default {
  name: "ExaminationList",
  components: {
    FunctionalAreas,
    ProductDescriptionToo,
    InformationsViewer,
    Upload,
    ExaminationApproval,
    FillAnInFormation,
    OperationRecords,
    viewInfo,
    // CheckDia,
    // AgentDia,
    // SignatureDia,
    financialInfo
  },
  data() {
    return {
      reviewer:null,//判断是否是审件专员!
      isNew: false,
      orderNumber: "",
      markUpdate: "",
      showButton: false,
      ProductUrl: "",
      showFillAnIn: true,
      dialogVisible: false,
      dialogVisibleAgent: false,
      dialogVisibleSignature: false,
      showForm: {},
      isContract: "",
      golbalPermissions: []
    };
  },
  created() {
    this.getOrderNum();
    this.getList();
    this.golbalPermissions = localStorage.getItem("permissions").split(",");


  },
  computed: {
    //财务信息按钮显示
    showBtn: function() {
      return checkPermiss("business:updateFinancial:lyf", this.golbalPermissions);

    },
    //财务信息
    showFinancialInfo: function() {
      return checkPermiss("business:upForm:financial:lyf", this.golbalPermissions);
    }
  },
  mounted() {
    this.getProductUrl();
   
  },
  methods: {
    // 担保合同模板下载
    cheackFun() {
      this.dialogVisible = true;
    },
    // 代理合同下载
    agentFun() {
      this.dialogVisibleAgent = true;
    },
    // 代理签字页下载
    signatureFun() {
      this.dialogVisibleSignature = true;
    },
    handleCloseAgent(done) {
      this.$confirm("确认关闭？")
        .then(() => {
          done();
          this.$refs.agentDia.formResetFields(true);
        })
        .catch(() => {});
    },
    handleCloseSignature(done) {
      this.$confirm("确认关闭？")
        .then(() => {
          done();
          this.$refs.SignatureDia.formResetFields(true);
        })
        .catch(() => {});
    },
    handleCloseCheck(done) {
      this.$confirm("确认关闭？")
        .then(() => {
          done();

          this.$refs.CheckDia.formResetFields(true);
        })
        .catch(() => {});
    },
    getList() {
      getFindForm({ orderNumber: this.orderNumber }).then(res => {
        this.showForm = res.data;
      });
    },
    getOrderNum() {
      let orderNumber = this.$route.query.orderNumber;
      if (orderNumber) {
        this.orderNumber = orderNumber;
      } else {
        this.orderNumber = sessionStorage.getItem("orderNumber");
      }
    },
    toshow(msg) {
      this.showFillAnIn = msg;
    },
    //根据orderNumber判断跳转的产品路径
    async getProductUrl() {
      await getProductUrl({ orderNumber: this.orderNumber }).then(res => {
        
        this.reviewer = res.data.reviewer; //判断是否是审件专员!
        this.ProductUrl = res.data.productUrl;
        this.isContract = res.data.isContract;
        
      });
       
    }
  }
};
</script>

<style scoped type="less">
.text {
  font-size: 20px;
  font-weight: bold;
  text-align: left;
  margin-top: 20px;
  text-indent: 2em;
}
.state {
  font-size: 22px;
  font-weight: bold;
  float: right;
  margin-top: -30px;
  margin-right: 3%;
}

.uploadStyle {
  position: relative;
  margin-top: 20px;
}
/deep/ .aa {
  position: relative;
}
/deep/ .dd {
  width: 65%;
  text-align: center;
}
/deep/ .bb {
  position: absolute;
  left: 60px;
}
/deep/ .cc {
  position: absolute;
  right: 8px;
  color: black;
  font-weight: bold;
}
</style>
